FROM zhangxin2477/mao-cloud:latest

LABEL auth="zhangxin,1367800014@qq.com,dog-cloud"
ADD *.sh /root/

ENV JDK_VERSION='17'
ENV JPOM_VERSION='2.11.6' JPOM_SERVER=true JPOM_AGENT=true

RUN chmod 755 /root/*.sh && \
    apt install openjdk-8-jdk -y && apt upgrade -y && \
    echo "export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/" >> /root/.bashrc && \
    echo "export CLASSPATH=.:\$JAVA_HOME/lib:\$JAVA_HOME/jre/lib" >> /root/.bashrc && \
    echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /root/.bashrc && \
    apt autoremove -y && apt autoclean

EXPOSE 2122/tcp 2123/tcp

ENTRYPOINT [ "/root/init.sh" ]